package cn.nexd.location.utils.threadpool;

/**
 * Created by codngfish on 15/11/6.
 */
public abstract class ThreadTaskSafeObject extends ThreadTaskObject {


    protected abstract void runOnSafeThread() throws Exception;

    protected abstract void throwException();

    @Override
    public void run() {
        try {
            this.runOnSafeThread();
        } catch (Exception e) {
            this.throwException();
        }
    }
}
